package my.diplom.dao.service;

import my.diplom.dao.IProjectDAO;
import my.diplom.entity.Project;
import my.diplom.entity.User;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gb
 * Date: 14.07.2009
 * Time: 17:25:59
 * To change this template use File | Settings | File Templates.
 */
public class ProjectService {

    private IProjectDAO projectDAO;

    public IProjectDAO getProjectDAO() {
        return projectDAO;
    }

    public void setProjectDAO(IProjectDAO projectDAO) {
        this.projectDAO = projectDAO;
    }

    public void create(Project project) {
        projectDAO.create(project);
    }

    public void update(Project project) {
        projectDAO.update(project);
    }

    public Project getById(Long projectId) {
        return projectDAO.getById(projectId);
    }

    public Project getById(Long projectId, boolean initUsers) {
        return projectDAO.getById(projectId, true);
    }

    public List<Project> getAll() {
        return projectDAO.getAll();
    }

    public Project getByName(String projectName) {
        return projectDAO.getByName(projectName);
    }

    public void delete(Project project) {
        projectDAO.delete(project);
    }

    public List<Project> getByUser(User user) {
        return projectDAO.getByUser(user);
    }

    public List<Project> getByLogin(String login) {
        return projectDAO.getByLogin(login);
    }
}
